package com.zxr.common.utils;

public class ExpireData {
    private String key;
    private String value;
    private long expireSeconds;//过期时长
    private long startTime;//保存时间
    private long endTime;//过期时间

    public ExpireData(String key, String value, Long expireSeconds) {
        this.key = key;
        this.value = value;
        this.expireSeconds = expireSeconds;
        this.startTime = System.currentTimeMillis() / 1000;
        this.endTime = startTime + expireSeconds;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public long getExpireSeconds() {
        return expireSeconds;
    }

    public void setExpireSeconds(long expireSeconds) {
        this.expireSeconds = expireSeconds;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }
}
